﻿// -------------------------------------------------------------------------
//    @FileName         :    NFCityNpcMgr.h
//    @Author           :    Gao.Yi
//    @Date             :    2025-09-29
//    @Email			:    445267987@qq.com
//    @Module           :    NFCityNpcMgr
//    @Desc             :
//
// -------------------------------------------------------------------------

#pragma once

#include "NFCityNpcSpawnData.h"
#include "NFComm/NFShmStl/NFShmHashMap.h"

class NFCityMapInst;
class NFCityNpc;
const int MAX_SPAWN_DATA_PER_MAP = 200;

class NFCityNpcMgr
{
public:
    NFCityNpcMgr();
    ~NFCityNpcMgr();
    int CreateInit();
    int ResumeInit();

public:
    int Init(NFCityMapInst* pMapInst);
    NFCityNpcSpawnData* FindSpawnData(int iId);
    int OnRemoveNpc(NFCityNpc* pNpc);
    int Tick();
private:
    int InitStaticNpc();
    int InitDynamicNpc();

    NFCityNpcSpawnData* AddSpawnData(int iId);
    bool IsSpawnDataFull() { return m_aoSpawnData.full(); }

private:
    int m_iMapInstID;
    int m_iMapDescID;

    NFShmHashMap<int, NFCityNpcSpawnData, MAX_SPAWN_DATA_PER_MAP> m_aoSpawnData;
};
